package com.example.controller;

import com.example.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Getter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Comment：最难的一次作业
 * @Date: 2023/10/26
 */


@RestController
@Api(tags = "测试接口")
public class TestController {

    @ApiOperation(value = "测试test")
    //只有拥有admin角色才能访问test接口
    @PreAuthorize("hasAuthority('USER_DELETE')")
    @GetMapping("/test")
    public Result test() {
        return Result.success("响应成功", "你好");
    }
}
